package cn.cqie.attendance.teacher.controller;

import cn.cqie.attendance.common.util.PageBean;
import cn.cqie.attendance.teacher.pojo.TeacherAttendance;
import cn.cqie.attendance.teacher.pojo.TeacherAttendanceReq;
import cn.cqie.attendance.teacher.pojo.TeacherPunch;
import cn.cqie.attendance.teacher.service.TeacherAttdanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author luwei
 * @date 2021/6/21 - 19:42
 */
@RestController
@Api(tags = "教师端-学生考勤管理")
@RequestMapping("/teacher/attendance")
public class TeacherAttendanceController {
    @Autowired
    TeacherAttdanceService teacherAttdanceService;

    @GetMapping("/queryAttendanceByTeacherId")
    @ApiOperation("教师查看课程下的学生的考勤")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "beginCreateTime", value = "2021-07-01"),
            @ApiImplicitParam(name = "endCreateTime", value = "2021-07-02"),
            @ApiImplicitParam(name = "stuClass", value = "1"),
            @ApiImplicitParam(name = "stuMajor", value = "1"),
            @ApiImplicitParam(name = "stuGrade", value = "1"),
            @ApiImplicitParam(name = "collegeId", value = "1"),
            @ApiImplicitParam(name = "stuNumber", value = "189000421"),
            @ApiImplicitParam(name = "stuName", value = "夏兵"),
            @ApiImplicitParam(name = "status", value = "0"),
            @ApiImplicitParam(name = "pageNum", value = "1"),
            @ApiImplicitParam(name = "pageSize", value = "10")
    })
    public PageBean<TeacherAttendance> queryAttendanceByTeacherId(TeacherAttendanceReq param){
        return teacherAttdanceService.queryAttendanceByTeacherId(param);
    }
    @GetMapping("/queryStudentPunchByTeacherId")
    @ApiOperation("教师查看课程下的学生的门禁打卡记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "startTime", value = "2021-07-01"),
            @ApiImplicitParam(name = "endTime", value = "2021-07-02"),
            @ApiImplicitParam(name = "stuNumber", value = "189000421"),
            @ApiImplicitParam(name = "stuName", value = "夏兵"),
            @ApiImplicitParam(name = "pageNum", value = "1"),
            @ApiImplicitParam(name = "pageSize", value = "10")
    })
    public  PageBean<TeacherPunch> queryStudentPunchByTeacherId(String startTime,String endTime,String stuNumber,String stuName,Integer pageNum, Integer pageSize){
        return teacherAttdanceService.queryStudentPunchByTeacherId(startTime,endTime,stuNumber,stuName,pageNum,pageSize);
    }
}
